package com.kacheap.configuration;

import java.nio.file.Paths;

import org.pf4j.JarPluginManager;
import org.pf4j.PluginManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;


@Configuration
@EnableWebMvc
public class Pf4jConfiguration {

	@Bean
    public PluginManager pluginManager() {
        // 创建一个插件管理器
        PluginManager pluginManager = new JarPluginManager(Paths.get("E:/pf4j-plugins"));
        
        // 加载插件
        pluginManager.loadPlugins();

        return pluginManager;
    }
	
	
}